package studentmanagement;

public class Teacher {
    private String id;
    private String name;
    private String gender;
    private Course course;  // 关联的课程

    // 构造方法
    public Teacher(String id, String name, String gender) {
        this.id = id;
        this.name = name;
        this.gender = gender;
    }

    // 教师授课方法
    public void teach(Course course) {
        this.course = course;
        System.out.println(name + "老师开始讲授《" + course.getCourseName() + "》");
    }

    // getter和setter
    public String getId() { return id; }
    public void setId(String id) { this.id = id; }
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    public String getGender() { return gender; }
    public void setGender(String gender) { this.gender = gender; }
    public Course getCourse() { return course; }
    public void setCourse(Course course) { this.course = course; }
}